home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_08_08 / 8n08114a < prev    next >
Text File  |  1990-07-17  |  3KB  |  88 lines

  1.  
  2. /*----------------------------------------------------------------------\
  3. |       Marcus W. Johnson 1990                                          |
  4. |                                                                       |
  5. |       Code to demonstrate IdentifyVideo()                             |
  6. \----------------------------------------------------------------------*/
  7.  
  8. #include        <stdio.h>
  9. #include        "video.h"
  10.  
  11. /* Print the name of the adaptor and the display device */
  12. static void     Name(struct video *v)
  13.         {
  14.         switch (v->VideoAdaptor)
  15.                 {
  16.                 case    UnknownAdaptor:
  17.                         puts("No Video Adaptor Detected");
  18.                         break;
  19.                 case    MDA:
  20.                         puts("Monochrome Display Adaptor");
  21.                         break;
  22.                 case    CGA:
  23.                         puts("Color Graphics Adaptor");
  24.                         break;
  25.                 case    EGA:
  26.                         puts("Enhanced Graphics Adaptor");
  27.                         break;
  28.                 case    MCGA:
  29.                         puts("Multi-Color Graphics Array");
  30.                         break;
  31.                 case    VGA:
  32.                         puts("Video Graphics Array");
  33.                         break;
  34.                 case    HGC:
  35.                         puts("Hercules Graphics Card");
  36.                         break;
  37.                 case    HGCPlus:
  38.                         puts("Hercules Graphics Card Plus");
  39.                         break;
  40.                 case    HerculesInColor:
  41.                         puts("Hercules InColor Card");
  42.                         break;
  43.                 default:
  44.                         puts("Program Error: Unidentified Video Adaptor");
  45.                         break;
  46.                 }
  47.         switch (v->VideoMonitor)
  48.                 {
  49.                 case    UnknownMonitor:
  50.                         puts("No Monitor Detected");
  51.                         break;
  52.                 case    MDAMonochrome:
  53.                         puts("Monochrome Monitor");
  54.                         break;
  55.                 case    CGAColor:
  56.                         puts("CGA Color Monitor");
  57.                         break;
  58.                 case    EGAColor:
  59.                         puts("EGA Color Monitor");
  60.                         break;
  61.                 case    PS2Monochrome:
  62.                         puts("PS/2 Monochrome Monitor");
  63.                         break;
  64.                 case    PS2Color:
  65.                         puts("PS/2 Color Monitor");
  66.                         break;
  67.                 default:
  68.                         puts("Program Error: Unidentified Video Monitor");
  69.                         break;
  70.                 }
  71.         }
  72.  
  73. /* Demonstates use of IdentifyVideo() */
  74. void    main()
  75.         {
  76.         struct video    *v;
  77.  
  78.         v = IdentifyVideo();
  79.         if (v->VideoAdaptor != UnknownAdaptor)
  80.                 {
  81.                 Name(v++);
  82.                 if (v->VideoAdaptor != UnknownAdaptor)
  83.                         Name(v);
  84.                 }
  85.         else
  86.                 puts("No known video adaptor or monitor");
  87.         }
  88.